// design-parking-system
package main

import "fmt"

const (
	BigCar    int = 1
	MidiumCar int = 2
	SmallCar  int = 3
)

type ParkingSystem struct {
	Big    int
	Medium int
	Small  int
}

func Constructor(big int, medium int, small int) ParkingSystem {
	return ParkingSystem{
		Big:    big,
		Medium: medium,
		Small:  small,
	}
}

func (this *ParkingSystem) AddCar(carType int) bool {
	switch carType {
	case BigCar:
		if this.Big > 0 {
			this.Big--
			return true
		}
		return false

	case MidiumCar:
		if this.Medium > 0 {
			this.Medium--
			return true
		}
		return false

	case SmallCar:
		if this.Small > 0 {
			this.Small--
			return true
		}
		return false
	}
	return false
}

func main() {
	s := Constructor(1, 1, 0)

	fmt.Print(s.AddCar(BigCar))
	fmt.Print(s.AddCar(MidiumCar))
	fmt.Print(s.AddCar(SmallCar))
	fmt.Print(s.AddCar(BigCar))
}
